<?php
include("../util/session.php");
require_once ("../config.inc.php");
require_once ("../include/mysql.inc.php");
require_once ("../include/res.inc.php");

$resDao = new Res();
$rows = $resDao->query();
//var_dump($rows);

?>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title></title>
	</head>
	<body>
		<?php
			require './inc_header.php';
		?>
		<a align="left" href="addupload.php">添加</a>
		<table width="800" border="1">
			<tr>
				<td width="10%">编号</td>
				<td width="10%">名称</td>
				<td width="10%">类型</td>
				<td width="20%">时间</td>
				<td width="10%">大小</td>
				<td width="10%">标签</td>
				<td width="10%">下载次</td>
				<td width="40%">操作</td>
			</tr>
			
			<?php 
				if ($rows) {
					foreach ($rows as $value) {
			?>
					<tr>
						<td><?php echo $value[id]?></td>
						<td><?php echo $value[name]?></td>  
						<td><?php echo $value[type]?></td>  
						<td><?php echo $value[time]?></td>
						<td><?php echo $value[size]?></td>
						<td><?php echo $value[tagName]?></td>
						<td><?php echo $value[loadNum]?></td>
						<td><a href="../action/res/deleteuploadfile.php?id=<?php echo $value[id] ?>&path=<?php echo $value[path] ?>&name=<?php echo $value[name] ?>">删除</a> | <a href="resUpdate.php?id=<?php echo $value[id] ?>">修改</a></td>
					</tr>
			<?php
					}
				}
			?>	
			
		</table>
	</body>
</html>